Chris Pollett > Old Classes >
CS158a

( Print View )

Student Corner:
  [Grades Sec2]

  [Submit Sec2]

  [Class Sign Up Sec2]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Mid]  [Final]

                           












HW#5 --- last modified February 28 2019 22:24:08..

Solution set.

Due date: May 13

Files to be submitted:
  Hw5.zip

Purpose: To experiment with socket programming and various aspects of network security.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO8 -- Understand TCP and UDP, and develop software for servers and clients of socket programming, and use them to measure the performance (including throughput and bandwidth) of real networks.

LO10 -- Understand concepts of data compression, network security and protocols.

Specification:

First do the following problems out of the book and submit them in your ZIP as either Hw1.txt or Hw1.pdf. Ch5: #29, 32, 39; Ch6: 5, 7.

For the coding part of the homework, I first want you to do the tests of Ch5 problem 48. To make the testing uniform put your code (or at least the driver class) in the file NetServer.java and NetClient.java. These should be runnable from the command line with lines like:

java NetServer protocol port_num message_file

and

java NetClient protocol host port_num loops

Here protocol is one of udp or tcp, port_num is the port number the server should bind to, message_file is the file that is sent by the server. For the client, host is the host to connect to, port_num is the port number the server is bound to, and loops indicates that after receiving the message file from the server, the client signals the server it is going to send it back. It does this loops many times (so loops=0 indicates, that it doesn't send the message back tot the server). You should make up your own file of the lengths the book recommends to test and put them in the Hw1.zip file your submit. The NetClient program is responsible for making a request to get the file from the server, it also should also output to the screen timings relevant to the questions asked in the problem. You should write up your results of your tests in writeup.txt.

Finally, as a last part of your homework, I would like you to experiment with a Unix-like command-line firewall. I want you to start running your server on port 07734 (flip upside-down for significance). Confirm that the port is bound to using netstat -a, lsof -i, and nmap. Then using a such a firewall (ipfw on a mac, iptables or ipchains on a linux system), do experiments by adding rules to block incoming, outbound, TCP, UDP, IP traffic to that port. Try different possibilities not each of these at the same time. Check that the firewall is working by trying to run your client from another machine to that port. Then try to use nmap on the client. See what is happening on the server using netstat, lsof. Write these tests up as well in writeup.txt. (Make sure to list all your teammates and their IDs, this is the last homework so it might be harder to come see me if there is a problem).

Point Breakdown

Book problems (.5 each) 2.5pts
NetServer and NetClient programs as described (1pt each) 2pts
Problem 48 (a), (b), (c) (1pt each) 3pts
Firewall experiments and write-up 2.5pts
Total10pts